package com.cctv.fmaed.module.redis.memory.enums;

/**
 * 缓存Key前缀枚举
 *
 * @author heyingcheng
 * @since 2023/9/1
 */
public enum CacheKeyPrefixEnum {

    /**
     * 设备ID
     */
    DEVICE_ID("{fmaed-wss-register}:device-id:"),
    /**
     * 设备GUID
     */
    DEVICE_GUID("{fmaed-wss-register}:device-guid:"),
    /**
     * 设备投屏状态
     */
    DEVICE_PS_STATE("fmaed-wss:device-ps-state:"),
    /**
     * 绑定设备GUID
     */
    BIND_DEVICE_GUID("{fmaed-wss-bind}:device-guid:"),
    /**
     * 绑定用户ID
     */
    BIND_USER_ID("{fmaed-wss-bind}:user-id:"),
    /**
     * 二维码UUID
     */
    QRCODE_UUID("{fmaed-wss-bind}:qr-code-uuid:"),
    /**
     * 用户ID
     */
    USER_ID("fmaed-api-register:user-id:"),
    /**
     * 服务器ID
     */
    SERVER_WSSID("fmaed-wss:wss-server:wssid:"),
    /**
     * 服务器实例
     */
    SERVER_INSTANCE("fmaed-wss:wss-server:instance:"),
    /**
     * 客户端
     */
    SERVER_CLIENT_NUMBER("fmaed-wss:wss-server:client-number"),
    /**
     * 客户端会话，存放每个客户端CLIENT_ID对应的SESSION信息
     */
    SERVER_CLIENT_SESSION("fmaed-wss:wss-client:session:"),
    ;

    public final String prefix;

    CacheKeyPrefixEnum(String prefix) {
        this.prefix = prefix;
    }

    public String key(String k) {
        return prefix.concat(k);
    }

}
